﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Common.Core;
using Domain.Model.Enums;
using SqlSugar.IOC;

namespace Domain.Repository.Sugar
{
    public class SugarIOCConfig
    {
        public static List<IocConfig> GetIocConfigs()
        {
            List<IocConfig> iocs = new List<IocConfig>();
            iocs.Add(new IocConfig()
            {
                ConfigId = EnumDbType.MyDB.ToString(),
                ConnectionString = ConfigurationUtil.App("ConnectionStrings", EnumDbType.MyDB.ToString()),
                DbType = IocDbType.SqlServer,
                IsAutoCloseConnection = true
            });
            iocs.Add(new IocConfig()
            {
                ConfigId = EnumDbType.MyDB2.ToString(),
                ConnectionString = ConfigurationUtil.App("ConnectionStrings", EnumDbType.MyDB2.ToString()),
                DbType = IocDbType.SqlServer,
                IsAutoCloseConnection = true
            });
            return iocs;
        }
    }
}
